<template>
  <div v-loading="loading"
       element-loading-text="拼命加载中"
       element-loading-spinner="el-icon-loading"
       element-loading-background="rgba(0, 0, 0, 0.8)">
    <div>
      <span class="demonstration">时间</span>
      <el-date-picker
        v-model="value3"
        type="datetimerange"
        range-separator="至"
        start-placeholder="开始日期"
        end-placeholder="结束日期">
      </el-date-picker>
      <el-input style="width: 30%"
                placeholder="请输入UID"
                v-model="inputDesc">
        <i slot="prefix" class="el-input__icon el-icon-search"></i>
      </el-input>
      <el-button type="primary" icon="el-icon-search" @click="onSearchClick()">搜索</el-button>
      <el-divider><i class="el-icon-zoom-in"></i></el-divider>
    </div>
    <el-table
      :data="tableData"
      border
      style="width: 100%"
      height="950">
      <el-table-column
        prop="uid"
        label="UID">
      </el-table-column>
      <el-table-column
        show-overflow-tooltip=""
        prop="interfaceName"
        label="接口">
      </el-table-column>
      <el-table-column
        prop="methodName"
        label="方法">
      </el-table-column>
      <el-table-column
        prop="args"
        label="参数">
      </el-table-column>
      <el-table-column
        prop="result"
        label="结果">
      </el-table-column>
      <el-table-column
        prop="createTime"
        label="时间">
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
  import axios from 'axios'

  const pageSizeConst = 30;
  export default {

    methods: {
      onSearchClick() {
        this.loading = true
        this.userUid = this.inputDesc
        axios.get("/record", {
          params: {
            startTime:this.value3[0].getTime(),
            endTime:this.value3[1].getTime(),
            uid: this.inputDesc
          }
        }).then(resp => {
          if (resp.data.result) {
            this.tableData = resp.data.msg
          }
          this.loading = false
        }).catch(err => {
          this.loading = false
        })
        //搜索
      },

    },
    computed: {
      request() {
        console.log(this.currentPage)
      },
    },
    data() {
      return {
        inputDesc: '',
        loading: false,
        tableData:[],
        uid: '',
        createTime: '',
        interfaceName: '',
        methodName: '',
        args: '',
        result: '',
        value3: [new Date(2019, 9, 7, 10, 10), new Date(2019, 9, 7, 10, 10)],
      }
    }
  }
</script>

<style scoped>

</style>
